/**
 * 用户相关的请求模块
 */
 import request from "@/utils/request"
 import store from '@/store/'
 /**
  * 用户登录
  */
 export const login = data => {
   return request({
     method: 'POST',
     url: '/admin/login',
     data
   })
 }
 export const sendSms = mobile => {
  return request({
    method: 'GET',
    url: `v1_0/sms/codes/${mobile}`
  })
}
export const getCurrentUser = () => {
  return request({
    method: 'get',
    url: '/admin/user/basicInfo'
  })
}

export const getUserChannels = () => {
  return request({
    method: 'GET',
    url: 'v1_0/user/channels'
  })

}

//注册
export const addUser = data => {
  return request({
    method: 'POST',
    url: 'admin/user/self-add',
    data
  })
}

//修改密码/
export const updatePwd = data => {
  return request({
    method: 'POST',
    url: 'admin/user/change-pwd',
    data
  })
}

//修改个人信息
export const updateUser = data => {
  return request({
    method: 'POST',
    url: 'admin/user/self-edit',
    data
  })
}

//我的浏览
export function getLook(params){
  return request({
    method: 'GET',
    url: `/admin/user/preview`,
    params
  })
}

//我的下载
export function getDown(params) {
  return request({
    method: 'GET',
    url: `/admin/user/downloads`,
    params
  })
}

//获取是否开启图片验证码
export function getCaptcha() {
  return request({
    method: 'GET',
    url: `/admin/common/captcha-require`,
  })
}
